package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-05-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_egg_level")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class GuEggLevel extends Model<GuEggLevel> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 1 金蛋 2 银蛋
     */
    @NotNull(message = "不能为空")
    private Integer type;

    /**
     * 等级
     */
    @NotNull(message = "不能为空")
    private Integer level;

    /**
     * 掉落概率
     */
    @NotNull(message = "不能为空")
    private BigDecimal probability;

    /**
     * 高概率
     */
    @NotNull(message = "不能为空")
    private BigDecimal highProbability;

    /**
     * 最小掉落
     */
    @Min(value = 0,message = "最少是0")
    private Integer min;

    /**
     * 最大掉落
     */
    @Min(value = 0,message = "最少是0")
    private Integer max;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
